-define (define_actions(Msg),
         do_action(Msg,Args)->
                lists:foldl(fun(X,ACC)->
                    apply(?MODULE,X,[ACC,Msg|Args]) 
                   end,[],?Msg)).    
-define (REQ_PING(MSG),aleph_dht_rpc:protocol(req,ping,MSG)).
-define (RSP_PONG(MSG),aleph_dht_rpc:protocol(rsp,pong,MSG)).
-define (REQ_FINDNODE(Target,Root,Key),aleph_dht_rpc:protocol(req,find_nodes,{Target,Root},Key)).          


-define (ping,[logger,ping_handler]).
-define (pong,[logger,pong_handler]).
-define (find_nodes,[logger,find_nodes_handler]).
-define (CONCURRENT_REQS,4).